{extend name="$base" /}
{block name="resources"}{/block}
{block name="right_tab"}{/block}
{block name="main"}
<table class="mytable">
	<tr>
		<th width="20%" style="text-align: left;">

		</th>
		<th  class="default-condition">
			<input type="text" id ='search_text' placeholder="输入申请人/手机号" class="input-common middle" />
			<select class="select-common middle" id="audit_status">
				<option value="">请选择审核状态</option>
				{volist name="audit_status" id="status"}
				<option value="{$key}">{$status.title}</option>
				{/volist}
			</select>
			<input type="button" onclick="LoadingInfo(1)" value="搜索" class="btn-common" />
		</th>
	</tr>
</table>
<div class="mod-table">
	<div class="mod-table-head">
		<div class="con style0list">
			<table class="table-class">
				<colgroup>
					<col style="width: 5%;">
					<col style="width: 10%;">
					<col style="width: 10%;">
					<col style="width: 15%;">
					<col style="width: 15%;">
					<col style="width: 15%;">
					<col style="width: 15%;">
					<col style="width: 15%;">
				</colgroup>
				<thead>
				<tr>
					<th><i class="checkbox-common"><input type="checkbox"  ></i></th>
					<th>申请人</th>
					<th>联系方式</th>
					<th>申请地区</th>
					<th>申请品类</th>
					<th>审核状态</th>
					<th>申请时间</th>
					<th>操作</th>
				</tr>
				</thead>
				<tbody></tbody>
			</table>
		</div>
	</div>
</div>
{/block}
{block name="script"}
{include file="admin/pageCommon" /}
<script type="text/javascript">
    //加载数据
    function LoadingInfo(page_index) {
        var search_text = $("#search_text").val();
        var audit_status = $("#audit_status").val();
        $.ajax({
            type : "post",
            url : "{:__URL('__URL__/nsfx/ADMIN_MODULE/regionagent/applyconfirmlist')}",
            data : {
                "page_index" : page_index,
                "page_size" : $("#showNumber").val(),
                "search_text" : search_text,
                "audit_status" : audit_status
            },
            success : function(data) {
                $("#page_count").val(data["page_count"]);
                $("#pageNumber a").remove();
                var html = '';
                if (data["data"].length > 0) {
                    for (var i = 0; i < data["data"].length; i++) {
                        html += '<tr align="center">';
                        html += '<td><div class="cell"><i class="checkbox-common"><input name="sub" type="checkbox" value="'+ data["data"][i]["level_id"] +'" ></i></div></td>';
                        html += '<td>' + data["data"][i]["nick_name"] + '</td>';
                        html += '<td>' + data["data"][i]["user_tel"] + '</td>';
                        html += '<td>' + data["data"][i]["address"] + '</td>';
                        //分类
                        html += '<td>';
							for(var c_i in data['data'][i]['category_arr']){
							    html += data['data'][i]['category_arr'][c_i]['category_name'] + '&nbsp;';
							}
						html += '</td>';
                        html += '<td>' + data["data"][i]["audit_status_name"] + '</td>';
                        html += '<td>' + timeStampTurnTime(data["data"][i]["apply_time"]) + '</td>';
                        html += '<td>';
                        	html +=	'<a href="'+__URL('__URL__/nsfx/ADMIN_MODULE/regionagent/applyconfirmdetail?apply_id='+ data["data"][i]["apply_id"])+'">详情</a>';
                        html +=	'</td> ';
                        html += '</tr>';
                    }
                } else {
                    html += '<tr align="center"><td colspan="8">暂无符合条件的数据记录</td></tr>';
                }

                $(".style0list tbody").html(html);
                initPageData(data["page_count"],data['data'].length,data['total_count']);
                $("#pageNumber").html(pagenumShow(jumpNumber,$("#page_count").val(),{$pageshow}));
            }
        });
    }
    //全选
    function CheckAll(event){
        var checked = event.checked;
        $(".style0list tbody input[type = 'checkbox']").prop("checked",checked);
    }

</script>
{/block}